// 平台---员工
export const goodsRules = {
  title: [
    { required: true, message: '请输入商品名称', trigger: 'change' },
    {
      validator: (rule, value, callback) => {
        if (value.length < 5) {
          callback(new Error('商品名称限制5-20个字'))
        } else if (value.length > 20) {
          callback(new Error('商品名称限制5-20个字'))
        } else {
          callback()
        }
      },
      trigger: 'blur'
    }
  ],
  categoryId: [
    { required: true, message: '请选择商品分类', trigger: 'change' }
  ]
}
